package service.impl;

import com.github.pagehelper.PageHelper;
import dao.IOrderDao;
import domain.Orders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import service.IOrderService;

import java.util.List;

/**
 * @author ：Yan Guang
 * @date ：Created in 2020/9/15 17:04
 * @description：
 */
@Service
@Transactional
public class OrderServiceImpl implements IOrderService {

    @Autowired
    private IOrderDao iOrderDao;

    @Override
    public List<Orders> findAll(int page,int size) throws Exception {
        PageHelper.startPage(page,size);//起始页面页码一，然后有五行
        return iOrderDao.findAll();
    }

    @Override
    public Orders findById(int orderId) throws Exception{
        return iOrderDao.findById(orderId);
    }
}
